home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-222.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  32.2 KB  |  833 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Sun, 06 Dec 92       Volume 1 : Issue 222
  2.  
  3. Today's Topics:
  4.  
  5.     System 7.0 popup CDEF works in dialogs / not in windows?
  6.     OS Queues (Enqueue and Dequeue) at Interrupt time?
  7.     Process Manager - no threads? (!)
  8.     Multi-Tasking Problems
  9.     C.S.M.P. Digest Easy View format file
  10.  
  11.  
  12.  
  13. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  14.  
  15. The digest is a collection of article threads from the internet newsgroup
  16. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  17. regularly and want an archive of the discussions.  If you don't know what a
  18. newsgroup is, you probably don't have access to it.  Ask your systems
  19. administrator(s) for details.  You can post articles to any newsgroup by
  20. mailing your article to newsgroup@ucbvax.berkeley.edu.  So, to post an
  21. article to comp.sys.mac.programmer, you mail it to
  22. comp-sys-mac-programmer@ucbvax.berkeley.edu.  Note the '-' instead of '.'
  23. in the newsgroup name.
  24.  
  25. Each issue of the digest contains one or more sets of articles (called
  26. threads), with each set corresponding to a 'discussion' of a particular
  27. subject.  The articles are not edited; all articles included in this digest
  28. are in their original posted form (as received by our news server at
  29. cs.uoregon.edu).  Article threads are not added to the digest until the last
  30. article added to the thread is at least one month old (this is to ensure that
  31. the thread is dead before adding it to the digest).  Article threads that
  32. consist of only one message are generally not included in the digest.
  33.  
  34. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  35. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  36. file /pub/mac/csmp-digest/README before downloading any files.  The most
  37. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  38. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  39. archive has a mail server; send a message with the text '$MACarch help' (no
  40. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  41.  
  42. The digest is also available via email.  Just send a note saying that you
  43. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  44. automatically receive each new issue as it is created.  Sorry, back issues
  45. are not available through the mailing list.
  46.  
  47. Send administrative mail to mkelly@cs.uoregon.edu.
  48.  
  49.  
  50. -------------------------------------------------------
  51.  
  52. From: engber@ils.nwu.edu (Mike Engber)
  53. Subject: System 7.0 popup CDEF works in dialogs / not in windows?
  54. Date: 2 Nov 92 23:08:03 GMT
  55. Organization: The Institute for the Learning Sciences
  56.  
  57.  
  58. I'm having trouble getting the System 7.0 & 7.1 popup menu CDEF
  59. to work in a regular window. It works fine in dialogs. In the
  60. window, I call TrackControl - the title inverts & tracks the mouse,
  61. but the menu doesn't pop.
  62.  
  63. Any ideas?
  64.  
  65. I'm pretty sure I covered all the obvious - the 'MENU' rsrc specified
  66. in contrlMin really exists. The control draws itself fine - with the
  67. first item in the 'MENU' rsrc showing in the popup box.
  68.  
  69. I'm pretty mystified.
  70.  
  71. please cc via email if possible
  72.  
  73. - -ME
  74.  
  75. +++++++++++++++++++++++++++
  76.  
  77. From: oster@well.sf.ca.us (David Phillip Oster)
  78. Date: 3 Nov 92 09:15:46 GMT
  79. Organization: Whole Earth 'Lectronic Link
  80.  
  81. In article <1992Nov2.230803.4746@ils.nwu.edu> engber@ils.nwu.edu (Mike Engber) writes:
  82. >I'm having trouble getting the System 7.0 & 7.1 popup menu CDEF
  83. >to work in a regular window. It works fine in dialogs. 
  84.  
  85. When you create the control, remember to set the contrlAction field to -1,
  86. so the control will autotrack. This is what the dialog manager does.
  87.  
  88. +++++++++++++++++++++++++++
  89.  
  90. From: engber@ils.nwu.edu (Mike Engber)
  91. Organization: The Institute for the Learning Sciences
  92. Date: Tue, 3 Nov 1992 16:13:28 GMT
  93.  
  94. >I'm having trouble getting the System 7.0 & 7.1 popup menu CDEF
  95. >to work in a regular window. It works fine in dialogs. In the
  96. >window, I call TrackControl - the title inverts & tracks the mouse,
  97. >but the menu doesn't pop.
  98.  
  99. I got at least one "me too" + lots of correct responses so far.
  100. So I figure it's worth posting the simple soln.
  101.  
  102. You need to pass -1 to TrackControl for the actionProc. Apparantly, the menu
  103. popping is performed by the CDEF's track routine.
  104.  
  105. It seems like passing -1 for the actionProc is the right thing to do in
  106. general - don't know why I got into the habit of passing NULL.
  107.  
  108. While I'm on the subject of the Sytem popup CDEF has anyone noticed:
  109.  
  110.  - The version in 7.1 no longer uses the 'mctb' resource to color
  111.    the menu. In 7.0  the 'mctb' info was used (not necessarily in
  112.    the way I would have used it, but it was used) 
  113.  
  114.  - In both 7.0 and 7.1 the control color table is ignored. It's think
  115.    it would be used for picking the frame and title color. Perhaps
  116.    even the popup box background & text color in the abscence of a
  117.    'mctb' rsrc.
  118.  
  119.  - The menu title jumps around to align itself with the top of
  120.    the current item. This is only noticable if the items vary
  121.    in height (i.e. some have icons). I'd think it would be preferable
  122.    to just vertically center the title as is done with the popup box.
  123.  
  124.  - Clicking on the title area pops the menu. I would have assumed this
  125.    was a dead area & only hitting the popup box mattered. I guess I
  126.    can't see any reason not to make the title area hot - but there sure
  127.    aren't any visual clues that it is.
  128.  
  129. - -ME
  130.  
  131. +++++++++++++++++++++++++++
  132.  
  133. From: ivanski@world.std.com (Ivan M CaveroBelaunde)
  134. Organization: The World Public Access UNIX, Brookline, MA
  135. Date: Tue, 3 Nov 1992 16:14:33 GMT
  136.  
  137. engber@ils.nwu.edu (Mike Engber) writes:
  138.  
  139.  
  140. >I'm having trouble getting the System 7.0 & 7.1 popup menu CDEF
  141. >to work in a regular window. It works fine in dialogs. In the
  142. >window, I call TrackControl - the title inverts & tracks the mouse,
  143. >but the menu doesn't pop.
  144. >Any ideas?
  145.  
  146. You need to do TrackControl(popupControlHandle,&clickPt,(ProcPtr)-1);
  147. If you don't use -1, the CDEF's action proc won't be called.
  148.  
  149. - -Ivan
  150.  
  151. +++++++++++++++++++++++++++
  152.  
  153. From: leonardr@netcom.com (Leonard Rosenthol)
  154. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  155. Date: Tue, 3 Nov 1992 21:19:22 GMT
  156.  
  157. In article <1992Nov3.161328.29740@ils.nwu.edu> engber@ils.nwu.edu (Mike Engber) writes:
  158. >While I'm on the subject of the Sytem popup CDEF has anyone noticed:
  159. >
  160. > - The version in 7.1 no longer uses the 'mctb' resource to color
  161. >   the menu. In 7.0  the 'mctb' info was used (not necessarily in
  162. >   the way I would have used it, but it was used) 
  163. >
  164.     Yup!  This is because I bitched enough to get it put on the Apple
  165. bug list since the popUP looks REALLY ugly when used on computers with 
  166. custom mctb's - especially with non-white background colors.
  167.  
  168. > - In both 7.0 and 7.1 the control color table is ignored. It's think
  169. >   it would be used for picking the frame and title color. Perhaps
  170. >   even the popup box background & text color in the abscence of a
  171. >   'mctb' rsrc.
  172. >
  173.     I believe the reasoning here was that even though it is a control, it
  174. should use the MENU information.  I could see this going either way. However,
  175. also remember that the PopUp was originally written for S'ystem 6 (CTB) where
  176. the control color table acted differently.
  177.  
  178. > - The menu title jumps around to align itself with the top of
  179. >   the current item. This is only noticable if the items vary
  180. >   in height (i.e. some have icons). I'd think it would be preferable
  181. >   to just vertically center the title as is done with the popup box.
  182. >
  183.     Never noticed this, but I believe it.
  184.  
  185. > - Clicking on the title area pops the menu. I would have assumed this
  186. >   was a dead area & only hitting the popup box mattered. I guess I
  187. >   can't see any reason not to make the title area hot - but there sure
  188. >   aren't any visual clues that it is.
  189. >
  190.     Just like clicking on the title of a checkbox (or radio button) is
  191. the same as clicking the "box".  
  192.  
  193.  
  194.  
  195. - -- 
  196. - -----------------------------------------------------------------------------
  197. Leonard Rosenthol            Internet:     leonardr@netcom.com
  198. Director of Advanced Technology        AppleLink:    MACgician
  199. Aladdin Systems, Inc.            GEnie:        MACgician
  200.  
  201.  
  202. +++++++++++++++++++++++++++
  203.  
  204. From: time@ice.com (Tim Endres)
  205. Date: Wed, 4 Nov 92 13:02:43 EST
  206. Organization: ICE Engineering, Inc.
  207.  
  208.  
  209. In article <1992Nov3.211922.27504@netcom.com> (comp.sys.mac.programmer), leonardr@netcom.com (Leonard Rosenthol) writes:
  210. > > - Clicking on the title area pops the menu. I would have assumed this
  211. > >   was a dead area & only hitting the popup box mattered. I guess I
  212. > >   can't see any reason not to make the title area hot - but there sure
  213. > >   aren't any visual clues that it is.
  214. > >
  215. >     Just like clicking on the title of a checkbox (or radio button) is
  216. > the same as clicking the "box".  
  217.  
  218. Agreed. And I think this functioning is *vital*. It allows me to look
  219. at the menu without "reselecting" the current selection. The problem
  220. is that some menu picks involve an action, and sometimes I simply
  221. do not want the action taken. By clicking on the title, I can get
  222. a look at the other items without highlighting any of them. Otherwise,
  223. I have to drag the mouse out of the menu before releasing.
  224.  
  225.  
  226.  
  227. tim endres - time@ice.com  -or- tbomb!time
  228. ICE Engineering, Inc - 8840 Main St, Whitmore Lake, MI 48189
  229. Phone (313) 449 8288 - FAX (313) 449-9208
  230. USENET - a slow moving self parody... ph
  231.  
  232. +++++++++++++++++++++++++++
  233.  
  234. From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
  235. Date: 4 Nov 92 21:36:56 GMT
  236. Organization: Computer Science Dept, QMW, University of London
  237.  
  238. In <1CE00001.hqujje@tbomb.ice.com> time@ice.com (Tim Endres) writes:
  239.  
  240. >>      Just like clicking on the title of a checkbox (or radio button) is
  241. >> the same as clicking the "box".
  242.  
  243. >Agreed. And I think this functioning is *vital*. It allows me to look
  244. >at the menu without "reselecting" the current selection. The problem
  245. >is that some menu picks involve an action, and sometimes I simply
  246. >do not want the action taken. By clicking on the title, I can get
  247. >a look at the other items without highlighting any of them. Otherwise,
  248. >I have to drag the mouse out of the menu before releasing.
  249.  
  250. I agree that the analogy with the titles of checkboxes and
  251. radio buttons is valid. However, I think Tim's reasoning is
  252. faulty: any application which doesn't allow you to click on a
  253. popup menu and release your button *without moving the mouse*
  254. is breaking Apple's guidelines on popup menus, which
  255. specifically comment on this. It's the programmers'
  256. responsibility to ensure that you can click-release on popup
  257. menus without changing things. Some applications do break these
  258. guidelines, notably those which use popups for styles, in which
  259. the object is to check or uncheck each item, rather than to
  260. choose one from the menu. THINK C breaks the rules in its
  261. Project Type dialog in this way, too.
  262.  
  263. Perhaps we could discuss this: is a popup menu a suitable way
  264. of implementing this kind of selection?
  265.  
  266. Jeremy
  267.  
  268. +++++++++++++++++++++++++++
  269.  
  270. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  271. Organization: University of Illinois at Urbana
  272. Date: Wed, 4 Nov 1992 21:30:10 GMT
  273.  
  274. time@ice.com (Tim Endres) writes:
  275.  
  276. >> > - Clicking on the title area pops the menu. I would have assumed this
  277. >> >   was a dead area & only hitting the popup box mattered. I guess I
  278. >> >   can't see any reason not to make the title area hot - but there sure
  279. >> >   aren't any visual clues that it is.
  280. >> >
  281. >>     Just like clicking on the title of a checkbox (or radio button) is
  282. >> the same as clicking the "box".  
  283.  
  284. >Agreed. And I think this functioning is *vital*. It allows me to look
  285. >at the menu without "reselecting" the current selection. The problem
  286. >is that some menu picks involve an action, and sometimes I simply
  287. >do not want the action taken. By clicking on the title, I can get
  288. >a look at the other items without highlighting any of them. Otherwise,
  289. >I have to drag the mouse out of the menu before releasing.
  290.  
  291. Except that the popup menu control doesn't work as you describe, at
  292. least in System 7.0 with 1.1.1 Tuneup. When you mouse down on a normal
  293. button and release the mouse when it is outside of the button,
  294. TrackControl returns 0. If you do the equivalent on a popup menu
  295. control, releasing while you are not on the menu, TrackControl returns
  296. 1. This is the wrong behavior, as far as I can tell.
  297.  
  298. But even if TrackControl did return 0 if you pull out of the menu
  299. (which I agree it should), the behavior that you like, of clicking and
  300. releasing on the title not counting as hitting the control, is exactly
  301. the opposite of what clicking the title of a checkbox does; clicking
  302. on the title of a control counts as a hit, though TrackControl may
  303. want to return some value indicating that was just a title hit as
  304. opposed to a menu hit. Either way, the 7.0 popup menu CDEF is doing it
  305. wrong.
  306.  
  307. pr
  308. - -- 
  309. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  310. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  311. System manager - Cognitive Science Group, Beckman Institute, UIUC
  312. Internet: resnick@cogsci.uiuc.edu
  313.  
  314. +++++++++++++++++++++++++++
  315.  
  316. From: engber@ils.nwu.edu (Mike Engber)
  317. Date: 4 Nov 92 23:25:17 GMT
  318. Organization: The Institute for the Learning Sciences
  319.  
  320. >...
  321. >specifically comment on this. It's the programmers'
  322. >responsibility to ensure that you can click-release on popup
  323. >menus without changing things. Some applications do break these
  324. >guidelines,
  325.  
  326. Try popping on the very bottom of the standard System 7.0 popup CDEF.
  327. It comes up with the next item down hilited. The reason is the distance
  328. from the top of the popup box to the bottom is greater than the height
  329. of the menu item. This is fixable by narrowing the hit area 1 pixel (as
  330. I do in my CDEF).
  331.  
  332. But here's a case w/o such an easy fix. The type-in popup menu
  333. CDEF which I've been working on has a popup box which is necessarily
  334. much taller than a menu item. This is because it's height matches
  335. the frame of an edit text item.
  336.  
  337. I can't narrow the hot area that much without it being a big
  338. irritation to users. I've no idea what to do. I tried nudging
  339. the mouse up a bit - it's too un-nerving.
  340.  
  341. If anyone has a soln I'd love to hear it.
  342.  
  343. >notably those which use popups for styles, in which
  344. >the object is to check or uncheck each item, rather than to
  345. >choose one from the menu. THINK C breaks the rules in its
  346. >Project Type dialog in this way, too.
  347. >
  348. >Perhaps we could discuss this: is a popup menu a suitable way
  349. >of implementing this kind of selection?
  350.  
  351. Perhaps one that just puts the title in the popup box and the
  352. items are only shown when it's popped. I have such a CDEF if you
  353. want to try it. It doesn't currently do the checking and unchecking,
  354. but that could easily be added.
  355.  
  356. ---------------------------
  357.  
  358. From: Mel Walker <mwalker@novell.com>
  359. Subject: OS Queues (Enqueue and Dequeue) at Interrupt time?
  360. Organization: Society for Anarchic Totalitarianism
  361. Date: Wed, 4 Nov 1992 21:41:17 GMT
  362.  
  363. Can I use Enqueue() and Dequeue() at interrupt time? Reading IM, I'm not
  364. sure. It seems that they turn off interrupts, but do they move memory? It
  365. would seem that they would have to. Yet, it also seems like they
  366. don't.(?) Would someone please clarify this for me?
  367.  
  368. - --Mel Walker
  369. mwalker@novell.com
  370. Disclaimer: Some Martians landed and stole my opinions. So if these
  371. opinions sound like they're coming from Mars, that's why.
  372.  
  373. +++++++++++++++++++++++++++
  374.  
  375. From: keith@taligent.com (Keith Rollin)
  376. Date: 5 Nov 92 01:46:43 GMT
  377. Organization: Taligent
  378.  
  379. In article <Bx7o8t.KAw@Novell.COM>, Mel Walker <mwalker@novell.com> wrote:
  380. > Can I use Enqueue() and Dequeue() at interrupt time? Reading IM, I'm not
  381. > sure. It seems that they turn off interrupts, but do they move memory? It
  382. > would seem that they would have to. Yet, it also seems like they
  383. > don't.(?) Would someone please clarify this for me?
  384.  
  385. Yes, you can definitely call Enqueue and Dequeue at interrupt time. That's
  386. what they are for. For instance, events such as key-down, mouse-down, and
  387. disk-inserted are posted to the event queue at interrupt time with those
  388. routines.
  389.  
  390. All those routines do is add a record to a linked list of records. They
  391. don't move memory (I'm not sure why you think they do).
  392.  
  393. I believe that an upcoming issue of "develop" will have an article showing
  394. how to use the queue routines for scheduling serialized asynchronous
  395. activity.
  396.  
  397. - -----
  398. Keith Rollin
  399. Phantom Programmer
  400. Taligent, Inc.
  401.  
  402. +++++++++++++++++++++++++++
  403.  
  404. From: absurd@apple.apple.com (Tim Dierks, software saboteur)
  405. Date: 5 Nov 92 01:56:55 GMT
  406. Organization: MacDTS Marauders
  407.  
  408. In article <Bx7o8t.KAw@Novell.COM>, Mel Walker <mwalker@novell.com> wrote:
  409. > Can I use Enqueue() and Dequeue() at interrupt time? Reading IM, I'm not
  410. > sure. It seems that they turn off interrupts, but do they move memory? It
  411. > would seem that they would have to. Yet, it also seems like they
  412. > don't.(?) Would someone please clarify this for me?
  413. > --Mel Walker
  414. > mwalker@novell.com
  415. > Disclaimer: Some Martians landed and stole my opinions. So if these
  416. > opinions sound like they're coming from Mars, that's why.
  417.  
  418. Yes, Enqueue and Dequeue are entirely safe to call at interrupt time;
  419. they're the safest way to maintain lists in this kind of a situation.
  420.  
  421. They don't need to allocate memory because you're responsible for
  422. allocating the memory for your queue entries; many people will allocate
  423. room for a number of entries as an array, then have two queues; one
  424. of available entries, and one of entries queued for processing.
  425. Thus, your task would Dequeue an empty block from the empty chain,
  426. fill it out, then Enqueue into the active queue.
  427.  
  428. Hope this helps (TM)
  429. Tim Dierks, but if I only had a .signature....
  430.  
  431. ---------------------------
  432.  
  433. From: peterc@cubetech.com (Peter Creath)
  434. Subject: Process Manager - no threads? (!)
  435. Date: 23 Oct 92 00:04:00 GMT
  436. Organization: Cube Technologies
  437.  
  438. I paged through the "IM: Processes" today and found, to my chagrin,
  439. no threading capabilities!
  440.  
  441. Surely when Apple release System 7 with interapplication communication
  442. and launching, etc. and the advent of the Process Manager they didn't
  443. leave out spawned child processes?
  444.  
  445. (SIGH.  I guess this means I'll have to write messy code to internally
  446. multitask until System 8, right?)
  447.  
  448. - ----------------------------------------------------------------------------
  449. Peter Creath                 "When I was a boy I was told that anybody could
  450. peterc@cubetech.com           become president; I'm beginning to believe it."
  451.                                                            -- Clarence Darrow
  452.  
  453. +++++++++++++++++++++++++++
  454.  
  455. From: johnsd2@jec324.its.rpi.edu (Daniel Norman Johnson)
  456. Date: 26 Oct 92 14:47:24 GMT
  457. Organization: Rensselaer Polytechnic Institute, Troy, NY.
  458.  
  459. In article <dx3uv972.gpasv3@moebius.cubetech.com>, peterc@cubetech.com (Peter Creath) writes:
  460. |> I paged through the "IM: Processes" today and found, to my chagrin,
  461. |> no threading capabilities!
  462. |> 
  463. |> Surely when Apple release System 7 with interapplication communication
  464. |> and launching, etc. and the advent of the Process Manager they didn't
  465. |> leave out spawned child processes?
  466.  
  467. Yep. :( You could write a separate (background) app and lauch THAT,
  468. but its still messy.
  469.  
  470. |> (SIGH.  I guess this means I'll have to write messy code to internally
  471. |> multitask until System 8, right?)
  472. |>                                                            -- Clarence Darrow
  473.  
  474. Well, you could. However there's a rather neat threading package called
  475. the "Task Manager" availiable at the usual ftp sites which does an excelent
  476. job of hiding the messyness from you. 'Tis only co-operative, and it
  477. saves your context by making a copy of teh stack (Rather than just moving
  478. the stack pointer to the next threads stack), but other than that it seems
  479. very nice to me. Take a look.
  480.  
  481. PS, does anyone know if the sort of stack-copying this thing does
  482. is evilnastybad and probably incomatible with System 27.2?
  483. - -- 
  484.             - Dan Johnson
  485. And God said "Jeeze, this is dull"... and it *WAS* dull. Genesis 0:0
  486.  
  487. These opinions have had all identifiying marks removed, and are untraceable.
  488. You'll never know whose they are.
  489.  
  490. +++++++++++++++++++++++++++
  491.  
  492. From: ksand@apple.com (Kent Sandvik)
  493. Date: Tue, 27 Oct 1992 03:57:11 GMT
  494. Organization: Apple
  495.  
  496. In article <dx3uv972.gpasv3@moebius.cubetech.com>, peterc@cubetech.com
  497. (Peter Creath) wrote:
  498. > I paged through the "IM: Processes" today and found, to my chagrin,
  499. > no threading capabilities!
  500.  
  501. Check out the Michael Gough article in develop #7, some people use
  502. it, even if I've heard valid critique about this package (source code
  503. is part of the article). Otherwise, as product managers say, stay
  504. tuned for future information.
  505.  
  506. Kent
  507. - -------------------
  508. Kent Sandvik (UUCP: ....!apple!ksand; INTERNET: ksand@apple.com)
  509. DISCLAIMER: Private activities on the Net.
  510.  
  511. +++++++++++++++++++++++++++
  512.  
  513. From: hammett@sbsu1.aukuni.ac.nz (Tim Hammett)
  514. Date: 27 Oct 92 20:46:51 GMT
  515. Organization: University of Auckland, New Zealand.
  516.  
  517. ksand@apple.com (Kent Sandvik) writes:
  518. >Check out the Michael Gough article in develop #7, some people use
  519. >it, even if I've heard valid critique about this package (source code
  520. >is part of the article). Otherwise, as product managers say, stay
  521. >tuned for future information.
  522.  
  523. Source code to the Threads package is not part of the article. As far as
  524. I know, source to the package has not been released. There is,
  525. however, code which shows how to use the package.
  526.  
  527. - --
  528. Tim Hammett, Botany Dept, Auckland University, New Zealand.
  529. t.hammett@aukuni.ac.nz   Phone: +64-9-373-7599 x8365    FAX: +64-9-373-7416
  530.  
  531. +++++++++++++++++++++++++++
  532.  
  533. From: cantrell@lamar.ColoState.EDU (Carol Cantrell)
  534. Date: 2 Nov 92 16:59:37 GMT
  535. Organization: Colorado State University, Fort Collins, CO  80523
  536.  
  537. How do I go about changing trap addresses from within an INIT?  And how do I
  538. make an INIT that continuously operates in the background?  There doesn't seem
  539. to be any help on this in Inside Mac.
  540.  
  541. Paul Cantrell
  542. Cantrell@Lamar.ColoState.EDU 
  543.  
  544. +++++++++++++++++++++++++++
  545.  
  546. From: d88-jwa@byse.nada.kth.se (Jon Wtte)
  547. Date: 2 Nov 92 21:22:11 GMT
  548. Organization: Royal Institute of Technology, Stockholm, Sweden
  549.  
  550. ntrell@lamar.ColoState.EDU (Carol Cantrell) writes:
  551.  
  552.    How do I go about changing trap addresses from within an INIT?  And how do I
  553.    make an INIT that continuously operates in the background?  There doesn't seem
  554.    to be any help on this in Inside Mac.
  555.  
  556. Of course there is.
  557.  
  558. NSetTrapAddress and jGNEFilter respectively.
  559.  
  560. - -- 
  561.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Suedoise (not french speaking) --
  562.   "It was, in fact, cool as all get-out.  Fortunately it was a little
  563.    too late (historically speaking) to be groovy."
  564.                      -- Dennis Pelton
  565.  
  566. +++++++++++++++++++++++++++
  567.  
  568. From: cantrell@lamar.ColoState.EDU (Carol Cantrell)
  569. Date: 3 Nov 92 04:37:35 GMT
  570. Organization: Colorado State University, Fort Collins, CO  80523
  571.  
  572. In article <D88-JWA.92Nov2222211@byse.nada.kth.se> d88-jwa@byse.nada.kth.se (Jon Wtte) writes:
  573. >ntrell@lamar.ColoState.EDU (Carol Cantrell) writes:
  574. >
  575. >   How do I go about changing trap addresses from within an INIT?  And how do I
  576. >   make an INIT that continuously operates in the background?  There doesn't seem
  577. >   to be any help on this in Inside Mac.
  578. >
  579. >Of course there is.
  580. >
  581. >NSetTrapAddress and jGNEFilter respectively.
  582.  
  583. I guess I'm just incredibly dense, but I this doesn't help!  I've tried
  584. NSetTrapAdress, but I can't get my INIT to allocate anything permanently in
  585. the system heap!  I've tried NewHandle, NewPtr, NewPtrSys, 
  586. SetZone(SystemZone()), etc, and of course I have a sysz resource, but none
  587. of it does any good.
  588.  
  589. As for JGNEFilter, I found it defined as a low-mem global in a Think C
  590. header, but it isn't documented in the Think C manual, or in Inside Mac's
  591. indexes in vol. 1, 2, 3, 4, 5, 6, or X-ref under constants or field names.
  592. Where is it?  What is it?
  593.  
  594. Thanks!  I'm desperate!
  595.  
  596. Paul Cantrell
  597. Cantrell@Lamar.ColoState.EDU
  598.  
  599. "In the beginning, the universe was created.  This has made a lot of people
  600. very angry and has been widely regarded as a bad move." --Douglas Adams
  601.  
  602.  
  603. +++++++++++++++++++++++++++
  604.  
  605. From: buckeye@spf.trw.com (John Wallace)
  606. Organization: TRW Sensor Data Processing Center, Redondo Beach, CA
  607. Date: Wed, 4 Nov 92 21:41:46 GMT
  608.  
  609. In article <Nov03.043735.67107@yuma.ACNS.ColoState.EDU> cantrell@lamar.ColoState.EDU (Carol Cantrell) writes:
  610. >
  611. >I've tried
  612. >NSetTrapAdress, but I can't get my INIT to allocate anything permanently in
  613. >the system heap!  I've tried NewHandle, NewPtr, NewPtrSys, 
  614. >SetZone(SystemZone()), etc, and of course I have a sysz resource, but none
  615. >of it does any good.
  616. >
  617.  
  618. You have to load your code into the system heap.  At INIT time, your
  619. INIT loads into its own application heap that is destroyed as soon as
  620. your INIT quits to allow the Mac to continue to boot.  If you want
  621. your patches to hang around, you must load your code into the system
  622. heap.
  623.  
  624. >As for JGNEFilter, I found it defined as a low-mem global in a Think C
  625. >header, but it isn't documented in the Think C manual, or in Inside Mac's
  626. >indexes in vol. 1, 2, 3, 4, 5, 6, or X-ref under constants or field names.
  627. >Where is it?  What is it?
  628.  
  629. jGNEFilter is a pointer located at $29A.  It contains pointer to a 
  630. procedure which is executed whenever a call to GetNextEvent or 
  631. WaitNextEvent is called.  It gives you the opportunity to do processing 
  632. with an event before it is returned to the caller.  The event is passed 
  633. in a register (I cannot remember which one).  
  634.  
  635. When you patch jGNEFilter, you must save the previous value in
  636. jGNEFilter so that you can jump to the old filter after you process the
  637. event yourself.  Otherwise all of the other folks that patch jGNEFilter
  638. (like screensavers) will stop functioning.
  639.  
  640. I recommend that you get Scott Knaster's "How to Write Macintosh
  641. Software" if you are interested in understanding how the Mac works at
  642. a lower level.  
  643.  
  644. You also should invest in MacNosy from Steve Jasik.  The only way that
  645. you find out how a lot of the low-memory globals are used is to
  646. disassemble the ROM.
  647.  
  648. >
  649. >Paul Cantrell
  650. >Cantrell@Lamar.ColoState.EDU
  651. >
  652.  
  653. Cheers!
  654. John
  655. - ----------
  656. John Wallace     buckeye@spf.trw.com
  657.  
  658.  
  659. ---------------------------
  660.  
  661. From: yjc@po.cwru.edu (Jerome Chan)
  662. Subject: Multi-Tasking Problems
  663. Date: 23 Oct 1992 15:52:38 GMT
  664. Organization: The Tofu Society of Singapore
  665.  
  666.   I use At Ease 1.0 and System 7.0.1.
  667.  
  668.   When running without the finder, some of the applications I use (e.g.
  669. NewsWatcher) won't allow me to use the application menu to switch to
  670. another application when it is busy. When running with the finder, I can
  671. switch out of the same situation just by clicking onto the desktop window.
  672.  
  673.   Does anyone know why the Macintosh behaves in this manner?
  674.  
  675. - ---
  676.  The Evil Tofu
  677.  
  678. +++++++++++++++++++++++++++
  679.  
  680. From: cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole)
  681. Date: 28 Oct 92 19:08:39 GMT
  682. Organization: University of Illinois at Urbana
  683.  
  684. In <yjc-231092115217@b61539.student.cwru.edu> yjc@po.cwru.edu (Jerome Chan) 
  685. writes:
  686.  
  687. >  I use At Ease 1.0 and System 7.0.1.
  688.  
  689. >  When running without the finder, some of the applications I use (e.g.
  690. >NewsWatcher) won't allow me to use the application menu to switch to
  691. >another application when it is busy. When running with the finder, I can
  692. >switch out of the same situation just by clicking onto the desktop window.
  693.  
  694. >  Does anyone know why the Macintosh behaves in this manner?
  695.  
  696. The key is in how each program is handling the application menu. The bottom 
  697. line is that careless programming that worked before there WAS an app menu 
  698. sometimes doesn't work now that the system has changed. 
  699.  
  700. +++++++++++++++++++++++++++
  701.  
  702. From: yjc@po.cwru.edu (Jerome Chan)
  703. Date: 28 Oct 92 21:21:59 GMT
  704. Organization: The Tofu Society of Singapore
  705.  
  706. In article <BwuIIG.H57@news.cso.uiuc.edu>, cole@alexia.lis.uiuc.edu (Sandra
  707. Stewart-Cole) wrote:
  708.  
  709. > The key is in how each program is handling the application menu. The bottom 
  710. > line is that careless programming that worked before there WAS an app menu 
  711. > sometimes doesn't work now that the system has changed. 
  712.  
  713. So how should the App Menu be handled? Do you have a clue?
  714.  
  715. - ---
  716.  The Evil Tofu
  717.  
  718. +++++++++++++++++++++++++++
  719.  
  720. From: cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole)
  721. Organization: University of Illinois at Urbana
  722. Date: Tue, 3 Nov 1992 20:35:25 GMT
  723.  
  724. In <yjc-281092162431@b61539.student.cwru.edu> yjc@po.cwru.edu (Jerome Chan) 
  725. writes:
  726.  
  727. >> The key is in how each program is handling the application menu. The bottom 
  728. >> line is that careless programming that worked before there WAS an app menu 
  729. >> sometimes doesn't work now that the system has changed. 
  730.  
  731. >So how should the App Menu be handled? Do you have a clue?
  732.  
  733. Frankly, I haven't a clue, beyond properly ignoring it. I haven't seen the 
  734. particular problemn arise in my own programs, and I can't watch exactly how 
  735. your problem is showing up, but I know that I have seen programs ignore the 
  736. application menu when they are busy, and yet have seen others that were 
  737. written long before system 7 that let it work fine. Since I don't have the 
  738. source for any of the finicky programs, I can't say for sure what they are 
  739. doing wrong, but since I am a very boring programmer (I pay attention to 
  740. Apple's guidelines and crib a good deal of sample code from them) I have never
  741. been able to reproduce the problem ( haven't tried, since no one pays me to try
  742. to reproduce a bug)  My suspicion is that the programs in question are just 
  743. being explicitly stupid masking out suspend events generated after the menu is 
  744. selected. I *THINK* that if your program acts as if it can take suspend events,
  745. it can then refuse them in the mask passed to _WaitNextEvent, and the system 
  746. will not switch it to the back until it accepts the suspend. I have not been 
  747. able to find a solid confirmation of this, but a couple of places in IM6 imply
  748. that if you have a SIZE resource that has the flag set to get suspend/resume 
  749. events, you don't get swapped out until you actually recieve the event.
  750.  
  751. +++++++++++++++++++++++++++
  752.  
  753. From: mhall@abc.comp.sys.mac.programmer (Matthew Hall)
  754. Date: 4 Nov 92 15:11:37 GMT
  755. Organization: Oberlin College Computer Science
  756.  
  757. Hello-
  758.     The problem is that when applications are busy and dim the
  759. menu bar, the user can no longer change the foreground application
  760. with the aplication menu.  I have had this problem.
  761.     The reason is that after dimming the menu bar, some
  762. applications ignore mouse down events in the menu bar.  They figure
  763. that everything is dim, why even try to handle an event.  I believe
  764. that multifinder and perhaps Sys7 patch (is it MenuSelect?  I forgot)
  765. to see if the app menu has been clicked on.  
  766.     The solution is to always handle menus.  If your app is busy,
  767. let the user pull down any menu he/she wants.  The menus will be dim,
  768. of course, and they won't be able to do anything, but the application
  769. menu will then be availible.
  770.  
  771. - -matt hall
  772. - --
  773. - -------------------------------------------------------------------------------
  774. Matt Hall.    mhall@occs.oberlin.edu  OR  SMH9666@OBERLIN.BITNET
  775.               (216)-775-6613 (That's a Cleveland Area code. Lucky Me)
  776.  
  777. "Life's good, but not fair at all"  -Lou Reed
  778.  
  779. +++++++++++++++++++++++++++
  780.  
  781. From: time@ice.com (Tim Endres)
  782. Date: Wed, 4 Nov 92 12:53:46 EST
  783. Organization: ICE Engineering, Inc.
  784.  
  785.  
  786. In article <Bx5qJ6.DIp@news.cso.uiuc.edu> (comp.sys.mac.programmer), cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole) writes:
  787. > selected. I *THINK* that if your program acts as if it can take suspend events,
  788. > it can then refuse them in the mask passed to _WaitNextEvent, and the system 
  789. > will not switch it to the back until it accepts the suspend. I have not been 
  790. > able to find a solid confirmation of this, but a couple of places in IM6 imply
  791. > that if you have a SIZE resource that has the flag set to get suspend/resume 
  792. > events, you don't get swapped out until you actually recieve the event.
  793.  
  794. This is not correct. Apple documentation, particularly technical notes,
  795. emphasize that you can not "delay" or otherwise ignore a SUSPEND event.
  796. When you are told you are going to be suspended, it is going to happen,
  797. whether or not you accept the event. You must honor SUSPEND and take
  798. appropriate action, or you will be surprised.
  799.  
  800. I do not remember off hand how the App Menu functions, but there is
  801. NOT ONE SINGLE LINE OF CODE in uAccess that refers to this menu. When
  802. I am in yielding loops, I dim all of my menus, and handle Apple Menu
  803. picks with calls to opendeskacc, so either the app menu looks like
  804. a desk acc pick, or it is handled in MenuSelect.
  805.  
  806.  
  807. tim endres - time@ice.com  -or- tbomb!time
  808. ICE Engineering, Inc - 8840 Main St, Whitmore Lake, MI 48189
  809. Phone (313) 449 8288 - FAX (313) 449-9208
  810. USENET - a slow moving self parody... ph
  811.  
  812. ---------------------------
  813.  
  814. From: mkelly@cs.uoregon.edu (Michael A. Kelly)
  815. Subject: C.S.M.P. Digest Easy View format file
  816.  
  817.  
  818. This is a format file for reading the C.S.M.P. Digest with Easy View.
  819.  
  820.  
  821. (This file must be converted with BinHex 4.0)
  822.  
  823.  
  824.  
  825. ---------------------------
  826.  
  827. End of C.S.M.P. Digest
  828. **********************
  829.